<?php
/**
* Arrow project mediator interface
*
* @version 1.0
* @license  GNU GPL
* @author Artur Kmera <artur.kmera@arrowplatform.org>
*/

interface IArrowMediator{
	const AS_TEXT = 0;
	const AS_ARRAY = 1;
	
	/**
	 * Returns input check result
	 *
	 * @return boolean
	 */
	public function getCheckResult(ArrowRequestContext $request);
	
	/**
	 * Returns mediator instance
	 *
	 * @return IMediator
	 */
	public static function getDefault();
	
	/**
	 * Returns after mediator action
	 * (if check result is OK)
	 * 
	 * @return ArrowBeanDescriptor
	 */
	public function getActionBean();
	
	/**
	 * Returns after mediator template
	 * (if check result is OK)
	 * 
	 * @return ArrowTemplateDescriptor
	 */
	public function getAfterTemplate();
	
	/**
	 * Returns static target (after validation) address 
	 *
	 * @return string
	 */
	public function getAfterAddress();
	
	/**
	 * Returns error as text ( for remote requests )
	 *
	 */
	public function getErrorAsText();
	
	/**
	 * Returns error as table [ errors => array() , alerts => array() )
	 *
	 */
	public function getErrorAsTable();
	
	/**
	 *  returns ErrorAsText or ErrorAsTable. It is depend on request param arrow_met (arrow mediator error type)
	 *  if dont exist or is equal 0 text is return else array is returned
	 *
	 */
	public function getError() ;
	
}
?>